/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_tipo_seguro")
@NamedQueries({
    @NamedQuery(name = "CexTipoSeguro.findAll", query = "SELECT c FROM CexTipoSeguro c")})
public class CexTipoSeguro implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cts_id")
    private Integer ctsId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "cts_nombre")
    private String ctsNombre;
    @Column(name = "cts_codigo")
    private Integer ctsCodigo;
    @OneToMany(mappedBy = "cexTipoSeguro", fetch = FetchType.LAZY)
    private List<CexHistoriaClinica> cexHistoriaClinicaList;

    public CexTipoSeguro() {
    }

    public CexTipoSeguro(Integer ctsId) {
        this.ctsId = ctsId;
    }

    public CexTipoSeguro(Integer ctsId, String ctsNombre) {
        this.ctsId = ctsId;
        this.ctsNombre = ctsNombre;
    }

    public Integer getCtsId() {
        return ctsId;
    }

    public void setCtsId(Integer ctsId) {
        this.ctsId = ctsId;
    }

    public String getCtsNombre() {
        return ctsNombre;
    }

    public void setCtsNombre(String ctsNombre) {
        this.ctsNombre = ctsNombre;
    }

    public Integer getCtsCodigo() {
        return ctsCodigo;
    }

    public void setCtsCodigo(Integer ctsCodigo) {
        this.ctsCodigo = ctsCodigo;
    }

    public List<CexHistoriaClinica> getCexHistoriaClinicaList() {
        return cexHistoriaClinicaList;
    }

    public void setCexHistoriaClinicaList(List<CexHistoriaClinica> cexHistoriaClinicaList) {
        this.cexHistoriaClinicaList = cexHistoriaClinicaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ctsId != null ? ctsId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexTipoSeguro)) {
            return false;
        }
        CexTipoSeguro other = (CexTipoSeguro) object;
        if ((this.ctsId == null && other.ctsId != null) || (this.ctsId != null && !this.ctsId.equals(other.ctsId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexTipoSeguro[ ctsId=" + ctsId + " ]";
    }
    
}
